<template>
  <div>
    <Header :left="true" leftText="返回" title="关闭加严申请" />
    <div>
      <!-- 未确认页面 -->
      <van-row style="margin-top: 20px">
        <div style="height: 15erm">
          <div style="margin-top: 5px; margin-bottom: 10px">
            <van-button
              type="primary"
              class="buttongroup1"
              @click="addmessage"
              color="#138087"
              >新增</van-button
            >
          </div>
        </div>
      </van-row>
      <div class="textScroll">
        <div
          v-for="(item, index) in itemsOne"
          :key="item.Id"
          style="position: relative"
        >
          <div style="width: 100%; background-color: #f3f4f8; height: 5px">
            <span></span>
          </div>

          <div class="divStyle">
            <van-row style="margin-left: 10px; margin-top: 10px" v-show="false">
              <van-col span="6"><b>id:</b></van-col>
              <van-col span="14">{{ item.Id }}</van-col>
            </van-row>

            <van-row style="margin-left: 10px; margin-top: 10px">
              <van-col span="6"><b>序号:</b></van-col>
              <van-col span="14">{{ index + 1 }}</van-col>
            </van-row>

            <van-row style="margin-left: 10px; margin-top: 10px">
                <van-col span="6"><b>生产线:</b></van-col>
                <van-col span="10">{{ item.PLineID }}</van-col>
            </van-row>

            <van-row style="margin-left: 10px; margin-top: 10px">
              <van-col span="6"><b>申请人:</b></van-col>
              <van-col span="14">{{ item.RequestMan }}</van-col>
              <van-col span="2">
                <van-button
                  color="#138087"
                  @click.stop="confirmmessage(item)"
                  style="
                    width: 85px;
                    height: 40px;
                    font-size: 12px;
                    position: absolute;
                    left: 80%;
                  "
                  type="primary"
                  text="详情"
                />
              </van-col>
            </van-row>

            <!-- <van-row style="margin-left: 10px; margin-top: 10px">
              <van-col span="6"><b>申请质量理由:</b></van-col>
              <van-col span="14">{{ item.RequestReason }}</van-col>
            </van-row> -->

            <van-row style="margin-left: 10px; margin-top: 10px">
              <van-col span="6"><b>创建日期:</b></van-col>
              <van-col span="14">{{ item.CreateDatetime }}</van-col>
            </van-row>

            <van-row style="margin-left: 10px; margin-top: 10px">
              <van-col span="6"><b>创建人:</b></van-col>
              <van-col span="14">{{ item.Creator }}</van-col>
            </van-row>

            <!-- <van-row style="margin-left: 10px; margin-top: 10px">
              <van-col span="10"><b>加严管控描述:</b></van-col>
              <van-col span="10">{{ item.StrictDescription }}</van-col>
            </van-row> -->
            <van-row
              style="
                margin-left: 10px;
                margin-top: 10px;
                border-bottom: 2px solid rgba(82, 76, 76, 0.39);
              "
            >
              <van-col span="6"> </van-col>
              <van-col span="3"> </van-col>
              <van-col span="6"> </van-col>
            </van-row>
          </div>
        </div>
        <!-- 循环数据结束 -->
        <!-- <van-empty v-if="itemsOne == ''" image="search" description="暂无数据" /> -->
      </div>
    </div>
  </div>
</template>

<script>
import {
  Col,
  Row,
  Form,
  Cell,
  Icon,
  Field,
  NumberKeyboard,
  Image as VanImage,
  Picker,
  popup,
  SubmitBar,
  Button,
  Loading,
  Overlay,
  Dialog,
  Toast,
  NoticeBar,
  Tag,
  Tab,
  Tabs,
  DatetimePicker,
  ImagePreview,
  CellGroup,
  Uploader,
  Cascader,
  Calendar,
  RadioGroup,
  Radio,
  Divider,
  Stepper,
  AddressList,
  Checkbox,
  CheckboxGroup,
} from "vant";

import "vue-easytable/libs/themes-base/index.css";
import { VTable } from "vue-easytable";
import { _httpClient as _httpClientApi } from "@/libs/api";
import { _httpClient } from "@/libs/apisie";
import { getToken, getBaseApiFrefix } from "@/libs/auth";
import Header from "@/components/header.vue";
import { storage } from "@/libs/utils";

Vue.use(Form);
Vue.use(Field);
Vue.use(Tab);
Vue.use(Tabs);
Vue.use(Overlay);
Vue.use(Loading);
Vue.use(Picker);
Vue.use(popup);
Vue.use(SubmitBar);
Vue.use(VanImage);
Vue.use(DatetimePicker);
Vue.use(Cascader);
Vue.use(Calendar);
Vue.use(Cell);
Vue.use(RadioGroup);
Vue.use(Radio);
Vue.use(Divider);
Vue.use(Stepper);
Vue.use(Button);
Vue.use(AddressList);
Vue.use(Checkbox);
Vue.use(CheckboxGroup);
Vue.use(Col);
Vue.use(Row);

export default {
  name: "tightclose",
  components: {
    Tab,
    Tabs,
    Form,
    Row,
    Col,
    Button,
    Header,
    Form,
    Cell,
    Icon,
    Field,
    NumberKeyboard,
    Dialog,
    Toast,
    NoticeBar,
    Row,
    Tag,
    popup,
    DatetimePicker,
    ImagePreview,
    CellGroup,
    Uploader,
    Col,
    Calendar,
    Cascader,
    Picker,
    RadioGroup,
    Radio,
    Divider,
    Stepper,
    VTable,
    AddressList,
    Checkbox,
    CheckboxGroup,
  },
  data() {
    return {
      itemsOne: [],
      itemsTwo: [],
      query: {
        ReqDescription: "",
        RequestMan: "",
      },
    };
  },

  created: function () {
    this.getUncheckedList();
  },

  methods: {
    //确认
    async addmessage() {
      api.openWin({
        name: "tightcloseitem01",
        url: "./tightenup-tightcloseitem01.html",
        pageParam: {
          status:false,
          form: {},
          isAdd: true,
        },
        reload: true,
      });
      setTimeout(function () {
        _this.$ac.closeWin();
      }, 2000);
    },
    //确认
    async confirmmessage(item) {
      api.openWin({
        name: "tightclosesureitem",
        url: "./tightenup-tightclosesureitem.html",
        pageParam: {
          item: item,
          show:false
        },
        reload: true,
      });
      setTimeout(function () {
        _this.$ac.closeWin();
      }, 2000);
    },
    //确认
    async selectDetails(item) {
      api.openWin({
        name: "tightcloseitem02",
        url: "./tightenup-tightcloseitem02.html",
        pageParam: {
          item: item,
        },
        reload: true,
      });
    },
    //查询未确审核调机数据
    async getUncheckedList() {
      let _this = this;
      try {
        let res = await _httpClient.get(
          _httpClient.getApiPrefix() +
            "/AddStrictCloseRequest/GetPageList?Checked=false&PageSize=100&PageIndex=1" +
            "&ReqDescription=" +
            this.query.ReqDescription +
            "&RequestMan=" +
            this.query.RequestMan
        );
        // if (res.Total == 0) {
        //   Toast.clear();
        // } else {
        Toast.clear();
        _this.itemsOne = res.Data;
        //}
      } catch (e) {
        Toast.fail(JSON.stringify(e));
      }
    },

  },
};
</script>

<style>
body {
  background-color: white;
}

.table-title-class {
  background-color: #304156;
  color: #fff;
}

.wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.buttongroup {
  float: right;
  width: 30%;
  margin-right: 10px;
  margin-top: 10px;
  margin-bottom: 20px;
}

.buttongroup1 {
  float: left;
  width: 30%;
  margin-right: 10px;
  margin-top: 10px;
  margin-bottom: 20px;
}

.container.dwo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.buttonLeft {
  position: fixed;
  bottom: 8px;
  float: left;
  width: 49%;
}

.formstyle {
  font-size: 15px;
  font-weight: bold;
  display: flex;
  align-items: center;
}

.radioteam {
  display: flex;
  align-items: center;
  padding-left: 13px;
  margin-top: 10px;
  margin-left: 34px;
  margin-bottom: 10px;
}

.buttonRight {
  position: fixed;
  bottom: 8px;
  float: right;
  left: 51%;
  width: 49%;
  background-color: #f22028;
  border-color: #f22028;
}

.textScroll {
  display: inline-block;
  position: fixed;
  top: 16%;
  bottom: 3rem;
  overflow: scroll;
  right: 10px;
  width: 100%;
  z-index: 1;
}

.message {
  font-size: 15px;
  margin-top: 5px;
  margin-left: -10px;
  font-weight: bold;
}

.mg5 {
  margin-right: 5px;
}

.tag_margin {
  margin: 2px 5px;
}

.card_under {
  height: 100%;
  width: 100%;
  margin: auto;
  background: #ffffff;
  border-radius: 25px;
  box-shadow: 0 0px 0px rgba(0, 0, 0, 0.3);
}

.card_icon {
  text-align: center;
  /* position: absolute; */
  height: 8rem;
  width: 80%;
  margin: 12% 10%;
  background: rgba(35, 180, 237, 1);
  border-radius: 25px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
}

.text {
  font-size: 18px;
  color: #4e4a67;
  margin: 8px auto auto 20px;
  line-height: 1.5rem;
  text-align: justify;
  font-weight: 600;
}

.text_small {
  font-size: 16px;
  color: red;
  margin: 8px auto auto 20px;
  line-height: 1.5rem;
  text-align: justify;
  font-weight: 700;
}

.text_scan {
  font-size: 16px;
  color: #4e4a67;
  margin: auto auto auto 20px;
  line-height: 1.5em;
  text-align: justify;
}

.divStyle {
  margin-left: 3px;
  margin-right: 3px;
}
</style>
